<?php

/**
 * sfGuardUserProfile form.
 *
 * @package    ##PROJECT_NAME##
 * @subpackage form
 * @author     ##AUTHOR_NAME##
 */
class sfGuardUserProfileForm extends BasesfGuardUserProfileForm
{
  public function configure()
  {
    $sf_guard_user = sfContext::getInstance()->getUser()->getGuardUser();  
     if ( $sf_guard_user->hasPermission('super_admin') || $sf_guard_user->getIsSuperAdmin() )
    {
       $this->setWidget('sucursal_id', new sfWidgetFormPropelChoice(array(
        'model' => 'Bbsucursal',
      'renderer_class'=> 'mbWidgetFormChosenChoice'
      )));

    $this->setValidator('sucursal_id', new sfValidatorPropelChoice(array(
        'model' => 'Bbsucursal'
      )));
    
     }else{
       unset($this['sucursal_id']);
     }
  }  
    
}
